/*
 * Copyright (c) 2022 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
 */

/**
 * @brief Header containing interrupt handler specific declarations for the
 * HAL Layer of the Wi-Fi driver.
 */

#ifndef __HAL_INTERRUPT_H__
#define __HAL_INTERRUPT_H__

#include "hal_api.h"

/**
 * hal_rpu_irq_enable() - Enables interrupts from the RPU.
 * @hal_dev_ctx: Pointer to HAL context.
 *
 * This function enables the interrupts from the RPU.
 *
 * Return: Status
 *		Pass : %WIFI_NRF_STATUS_SUCCESS
 *		Error: %WIFI_NRF_STATUS_FAIL
 */
enum wifi_nrf_status hal_rpu_irq_enable(struct wifi_nrf_hal_dev_ctx *hal_dev_ctx);


/**
 * hal_rpu_irq_disable() - Disables interrupts from the RPU.
 * @hal_dev_ctx: Pointer to HAL context.
 *
 * This function disables the interrupts from the RPU.
 *
 * Return: Status
 *		Pass : %WIFI_NRF_STATUS_SUCCESS
 *		Error: %WIFI_NRF_STATUS_FAIL
 */
enum wifi_nrf_status hal_rpu_irq_disable(struct wifi_nrf_hal_dev_ctx *hal_dev_ctx);


/**
 * hal_rpu_irq_process() - Processes an interrupt from the RPU.
 * @hal_dev_ctx: Pointer to HAL context.
 *
 * This function is an interrupt handler for the interrupts generated by the
 * RPU. This function does the following:
 *
 *    - Stores the event details for as many events as available,into local
 *      buffers and queues them to the event queue for deferred
 *      processing.  (Refer to hal_eventq_process for the
 *      deferred handler).
 *    - Acknowledges the RPU interrupt.
 *
 * Return: Status
 *		Pass : %WIFI_NRF_STATUS_SUCCESS
 *		Error: %WIFI_NRF_STATUS_FAIL
 */
enum wifi_nrf_status hal_rpu_irq_process(struct wifi_nrf_hal_dev_ctx *hal_dev_ctx);
#endif /* __HAL_INTERRUPT_H__ */
